<%--
  Created by IntelliJ IDEA.
  User: 86173
  Date: 2021/5/20
  Time: 6:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<title>学生管理系统</title>
<script src="js/jquery-1.10.2.js"></script>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/materialdesignicons.min.css" rel="stylesheet">
<link href="css/style.min.css" rel="stylesheet">
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script src="js/common.js"></script>
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>

<link href="css/ui-lightness/jquery-ui-1.10.4.custom.css"
      rel="stylesheet">
<script src="js/jquery-ui-1.10.4.custom.js"></script>
<script type="text/javascript">
    $(function () {
    });
</script>
<style type="text/css">
    .title1 {
        background: #EEE url() repeat;
        text-shadow: 3px -3px black, 2px -2px white;
        font-size: 24px;
        font-weight: bold;
        -webkit-text-fill-color: transparent;
        -webkit-background-clip: text;
    }
</style>
<script type="text/javascript">
    $(document).ready(function () {
        //学生管理
        var stuFormArray = ["stuFormRegister.action"];
        var showAllStuArray = ["stuModify.action", "stuModifySuc.action", "stuSeeing.action"];
        var stuSearchArray = ["stuSearchSuc.action"];
        var stuSearchByGradeArray = ["stuSearchSucByGrade.action"];


        //教师管理
        var teacherFormArray = ["teacherFormRegister.action"];
        var showAllTeacherArray = ["teacherModify.action", "teacherModifySuc.action", "teacherSeeing.action"];
        var teacherSearchArray = ["teacherSearchSuc.action"];

        //班级管理
        var gradeTeachingChoseArray = ["teachingArrangeForm.action", "teachingArrangeSee.action", "teachingArrangeModify.action"];

        //成绩管理
        var scoreEnterChoseArray = ["scoreEnterSimpleStu.action", "scoreEnterSimpleStuSuc.action", "scoreEnterForm.action", "scoreRecordFinish.action"];

        var scoreQueryArray = ["scoreQueryResult.action","scoreQueryResultSecond.action","scoreQueryResultFour.action","scoreQueryResultThird.action","scoreQueryResultFive.action"];


        var scoreModifyArray = ["scoreModifyResult.action","scoreModifyResultSuc.action","scoreModifyResultGrade.action","scoreModifyResultGradeSuc.action"];

        var scoreDeleteArray = ["scoreDeleteResult.action", "scoreDeleteResultSuc.action", "scoreDeleteResultGrade.action","scoreDeleteResultGradeSuc.action"];

        var scoreCountArray = ["scoreCountSuc.action","scoreCountNianJi.action"];

        //教师角色的权限
        var teacherRoleArray = ["teacherScoreAdd.action", "teacherScoreAddSuc.action", "teacherScoreDel.action", "teacherScoreDelSuc.action", "teacherScoreModify.action", "teacherScoreModifySuc.action", "teacherScoreSeeing.action"]

        //学生角色的权限
        var studentRoleArray = ["stuScoreSearch.action"];

        var currentUrl = window.location.pathname;
        var curs = currentUrl.split("/");
        currentUrl = curs[2];
        console.log(currentUrl);
        $(".second-menu").each(function (i, e) {
            console.log($(e).children("a").attr('href'));
            var menuUrl = $(e).children("a").attr('href');
            if ($(e).children("a").attr('href').indexOf(currentUrl) == 0) {
                $(e).addClass('active');
                $(e).parent("ul").parent("li").addClass("active open");
            } else {
                //学生信息添加
                if (stuFormArray.indexOf(currentUrl) > -1 && menuUrl == "stuForm.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //学生信息编辑
                if (showAllStuArray.indexOf(currentUrl) > -1 && menuUrl == "showAllStu.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //学生信息查询
                if (stuSearchArray.indexOf(currentUrl) > -1 && menuUrl == "stuSearch.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //班级信息查询
                if (stuSearchByGradeArray.indexOf(currentUrl) > -1 && menuUrl == "stuSearchByGrade.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //教师信息添加
                if (teacherFormArray.indexOf(currentUrl) > -1 && menuUrl == "teacherForm.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //教师信息编辑
                if (showAllTeacherArray.indexOf(currentUrl) > -1 && menuUrl == "showAllTeacher.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }
                //教师信息查询
                if (teacherSearchArray.indexOf(currentUrl) > -1 && menuUrl == "teacherSearch.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //班级教学安排
                if (gradeTeachingChoseArray.indexOf(currentUrl) > -1 && menuUrl == "gradeTeachingChose.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //成绩导入
                if (scoreEnterChoseArray.indexOf(currentUrl) > -1 && menuUrl == "scoreEnterChose.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //成绩查询和分析
                if (scoreQueryArray.indexOf(currentUrl) > -1 && menuUrl == "scoreQuery.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //成绩修改
                if (scoreModifyArray.indexOf(currentUrl) > -1 && menuUrl == "scoreModify.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //成绩删除
                if (scoreDeleteArray.indexOf(currentUrl) > -1 && menuUrl == "scoreDelete.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //成绩统计
                if (scoreCountArray.indexOf(currentUrl) > -1 && menuUrl == "scoreCount.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //教师角色
                if (teacherRoleArray.indexOf(currentUrl) > -1 && menuUrl == "teacherMain.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

                //学生角色 studentRoleArray
                if (studentRoleArray.indexOf(currentUrl) > -1 && menuUrl == "stuMain.action") {
                    $(e).addClass('active');
                    $(e).parent("ul").parent("li").addClass("active open");
                    return;
                }

            }
        });
    });
</script>